Optimal. Leaf size=73 \[ \frac{a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac{a (a-4 b) \tan (e+f x)}{2 f}+\frac{1}{2} a x (a-4 b)+\frac{b^2 \tan ^3(e+f x)}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0989284, antiderivative size = 73, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.217, Rules used = {4132, 463, 459, 321, 203} \[ \frac{a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac{a (a-4 b) \tan (e+f x)}{2 f}+\frac{1}{2} a x (a-4 b)+\frac{b^2 \tan ^3(e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4132
Rule 463
Rule 459
Rule 321
Rule 203
Rubi steps
\begin{align*} \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^2(e+f x) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^2 \left (a+b+b x^2\right )^2}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac{\operatorname{Subst}\left (\int \frac{x^2 \left (3 a^2-2 (a+b)^2-2 b^2 x^2\right )}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac{a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac{b^2 \tan ^3(e+f x)}{3 f}-\frac{(a (a-4 b)) \operatorname{Subst}\left (\int \frac{x^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=-\frac{a (a-4 b) \tan (e+f x)}{2 f}+\frac{a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac{b^2 \tan ^3(e+f x)}{3 f}+\frac{(a (a-4 b)) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac{1}{2} a (a-4 b) x-\frac{a (a-4 b) \tan (e+f x)}{2 f}+\frac{a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac{b^2 \tan ^3(e+f x)}{3 f}\\ \end{align*}
Mathematica [A] time = 0.988913, size = 126, normalized size = 1.73 \[ -\frac{\sec ^3(e+f x) \left (a \cos ^2(e+f x)+b\right )^2 \left (3 a \cos ^3(e+f x) (a \sin (2 (e+f x))-2 f x (a-4 b))-4 b (6 a-b) \sec (e) \sin (f x) \cos ^2(e+f x)-4 b^2 \tan (e) \cos (e+f x)-4 b^2 \sec (e) \sin (f x)\right )}{3 f (a \cos (2 (e+f x))+a+2 b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.049, size = 71, normalized size = 1. \begin{align*}{\frac{1}{f} \left ({a}^{2} \left ( -{\frac{\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) }{2}}+{\frac{fx}{2}}+{\frac{e}{2}} \right ) +2\,ab \left ( \tan \left ( fx+e \right ) -fx-e \right ) +{\frac{{b}^{2} \left ( \sin \left ( fx+e \right ) \right ) ^{3}}{3\, \left ( \cos \left ( fx+e \right ) \right ) ^{3}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.48454, size = 90, normalized size = 1.23 \begin{align*} \frac{2 \, b^{2} \tan \left (f x + e\right )^{3} + 12 \, a b \tan \left (f x + e\right ) + 3 \,{\left (a^{2} - 4 \, a b\right )}{\left (f x + e\right )} - \frac{3 \, a^{2} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{6 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.503966, size = 189, normalized size = 2.59 \begin{align*} \frac{3 \,{\left (a^{2} - 4 \, a b\right )} f x \cos \left (f x + e\right )^{3} -{\left (3 \, a^{2} \cos \left (f x + e\right )^{4} - 2 \,{\left (6 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, b^{2}\right )} \sin \left (f x + e\right )}{6 \, f \cos \left (f x + e\right )^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.21921, size = 97, normalized size = 1.33 \begin{align*} \frac{2 \, b^{2} \tan \left (f x + e\right )^{3} + 12 \, a b \tan \left (f x + e\right ) + 3 \,{\left (a^{2} - 4 \, a b\right )}{\left (f x + e\right )} - \frac{3 \, a^{2} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{6 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]